﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace WorkOrder.Models;

/// <summary>
/// 工单评论表
/// </summary>
[Table("工单评论表")]
[Index("用户id", Name = "fk_评论_用户")]
[Index("工单id", Name = "idx_工单")]
public partial class 工单评论表
{
    /// <summary>
    /// 评论ID
    /// </summary>
    [Key]
    [Column("评论ID")]
    public long 评论id { get; set; }

    /// <summary>
    /// 工单ID
    /// </summary>
    [Column("工单ID")]
    [StringLength(50)]
    public string 工单id { get; set; }

    /// <summary>
    /// 评论人
    /// </summary>
    [Column("用户ID")]
    [StringLength(50)] 
    public string 用户id { get; set; }

    /// <summary>
    /// 评论内容
    /// </summary>
    [Column(TypeName = "text")]
    public string 评论内容 { get; set; } = null!;


        /// <summary>
    /// 评论类型
    /// </summary>
    [Column("评论类型")]
    [StringLength(20)]
    public CommentType 评论类型 { get; set; } // 新增字段，用于区分评论类型

    /// <summary>
    /// 是否内部可见
    /// </summary>
    public bool 是否内部可见 { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime 创建时间 { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime 更新时间 { get; set; }

    [ForeignKey("工单id")]
    [InverseProperty("工单评论表s")]
    public virtual 工单主表 工单 { get; set; } = null!;
}
